package com.ztools.common.model.pc.store;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ztools.common.model.pc.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;

/**
 * @author seeTools
 * @since 2023-05-27
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("store_stock")
public class StoreStock extends BaseModel {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 商品ID
     */
    @TableField(value = "commodity_id")
    private Long commodityId;

    /**
     * 商品名称
     */
    @TableField(exist = false)
    private String commodityName;

    /**
     * 商品自编码
     */
    @TableField(value = "custom_code")
    private String customCode;

    /**
     * 库存数量
     */
    @TableField(value = "quantity")
    private Integer quantity;

    /**
     * 成本价
     */
    @JSONField(format = "#0.00")
    @TableField(value = "cost_price")
    private BigDecimal costPrice;

    /**
     * 销售价
     */
    @JSONField(format = "#0.00")
    @TableField(value = "sale_price")
    private BigDecimal salePrice;

    /**
     * 商品单位
     */
    @TableField(exist = false)
    private String unit;


}
